{include file="header.html"}
<script type="text/javascript" src="mobile/js/mobile_notice.js"></script>
<script type="text/javascript">
function register() {
    var ret_url = $("#ret_url").attr("value");
    var password = $("#password").val();
    var user_name = $("#user_name").val();
    var email = $("#email").val();
    var password_confirm = $("#password_confirm").val();
    var captcha = $("#captcha1").val();
    var agree = $('#clause').prop('checked') ? 1 : 0; 
					
	$.ajax({
		url: REAL_SITE_URL + '/index.php?app=member&act=register',
		data: {
			'user_name': user_name,
			'password': password,
			'password_confirm': password_confirm,
			'email': email,
			'agree': agree,
			'captcha': captcha
		},
		type: 'post',
		dataType: 'json',
 		async: false,
		success: function(data) {
			if(data.done){
				errormsg(data.msg);
				setTimeout(function() {
					window.location.href = ret_url ? unescape(ret_url) : REAL_SITE_URL + "/index.php";
 				}, 1500);
			} else {
 				errormsg(data.msg);
			}
		}
	})
}
</script>

<div id="main">

	<div id="page-auth" class="page-register page-body">

        <dl class="form pb20">

				<dd><input type="text" id="user_name" name="user_name" class="input" placeholder=" {$lang.user_name_limit}"/></dd>

                <dd><input type="password" id="password" name="password" class="input" placeholder=" {$lang.password_length_limit}"/></dd>

                <dd><input type="password" name="password_confirm" id="password_confirm" class="input" placeholder=" {$lang.input_comfirm_password}"/></dd>

				<dd><input type="text" name="email" id="email" class="input" placeholder=" {$lang.input_email}"/></dd>
				<!--{if $captcha}-->

                <dd class="captcha-box">

                    <input type="text" name="captcha" class="input captcha" id="captcha1" placeholder=" {$lang.input_captcha}" />

                    <img id="captcha" src="{$real_site_url}/index.php?app=captcha&amp;{$random_number}" onclick="javascript:change_captcha($('#captcha'));" /><br />

                </dd>

                <!--{/if}-->

                <dd class="block mb10 clearfix read-licence">

					<input id="clause" type="checkbox"  name="agree" value="1" checked="checked"  /> 

                	<label for="clause" style="color:#333;" >

                		{$lang.i_have_read} <a href="{url app=article&act=system&code=eula}" target="_blank">{$lang.mall_eula}</a>

                	</label>

                </dd>

				<input type="button" onclick="register();" class="enter yahei"  value="{$lang.register}" />

                <input type="hidden" name="ret_url" value="{$ret_url}" />

                <p class="mt20"><a href="{url app=member&act=login}">{$lang.already_have_account}</a></p>

		</dl>

	</div>

</div>

{include file="footer.html"}

